k = int(input())

num = ((2*k+0.25)**0.5 - 0.5)//1

testday = num * (num + 1)//2

spday = k - testday

cout = num * (num+1) *(num+0.5) //3 + spday * (num+1)

print("%d"%cout)